package com.atguigu.gmall.order.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.vo.order.OrderSubmitVo;
import com.atguigu.gmall.order.service.OrderDetailService;
import com.atguigu.gmall.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2025/9/13 1:42
 */
@RestController
@RequestMapping("/api/order/auth")
public class OrderController {
    @Autowired
    OrderInfoService orderInfoService;
    @PostMapping("/submitOrder")
    public Result submitOrder(@RequestParam("tradeNo") String tradeNo,
                              @RequestBody OrderSubmitVo orderSubmitVo) {
        Long orderId=orderInfoService.submitOrder(tradeNo, orderSubmitVo);
        return Result.ok(orderId.toString());
    }
}
